package com.lswms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.lswms.common.service.impl.CrudServiceImpl;
import com.lswms.dao.YnDcUserBlackDao;
import com.lswms.dto.YnDcUserBlackDTO;
import com.lswms.entity.YnDcUserBlackEntity;
import com.lswms.service.YnDcUserBlackService;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 黑名单用户信息
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2020-07-24
 */
@Service
public class YnDcUserBlackServiceImpl extends CrudServiceImpl<YnDcUserBlackDao, YnDcUserBlackEntity, YnDcUserBlackDTO> implements YnDcUserBlackService {

    @Override
    public QueryWrapper<YnDcUserBlackEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        String username = (String)params.get("username");

        QueryWrapper<YnDcUserBlackEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);
        wrapper.eq(StringUtils.isNotBlank(username), "username", username);

        return wrapper;
    }


}